速報APP / 教育 / CSCS Native Scripting

CSCS Native Scripting

價格:免費

檔案大小:134.4 MB

版本需求:需要 iOS 8.0 或以上版本。與 iPhone、iPad 及 iPod touch 相容。

支援語言:俄文, 德語, 日語, 法文, 簡體中文, 義大利文, 英語, 葡萄牙文, 西班牙文, 阿拉伯文

CSCS Native Scripting(圖1)-速報App

CSCS (Customized Scripting in C#) can now be used for native mobile development.

This App contains a CSCS interpreter that you can use to play around with CSCS. There are also a few pre-set examples.

How to use CSCS for mobile development is described at:

- https://msdn.microsoft.com/en-us/magazine/mt829272

- http://www.codemag.com/article/1711081

A Syncfusion E-book describing CSCS:

- https://www.syncfusion.com/resources/techportal/details/ebooks/implementing-a-custom-language

Another Syncfusion E-book on how to use it for mobile development is coming up soon.

This App itself was produced in CSCS. Here is the complete CSCS code:

=========================

AutoScale();

AddOrSelectTab("Create", "test.png", "test2.png");

__locComboFiles = GetLocation("ROOT", "CENTER", "ROOT", "TOP", -80, 6);

AddCombobox(__locComboFiles, "__comboFiles", "center:white:clear", 340, 50);

CSCS Native Scripting(圖2)-速報App

__optionsComboFiles = {"Init", "Hello, World!", "Ads", "Busy Indicators", "Unit Tests"};

AddWidgetData(__comboFiles, __optionsComboFiles, "", "center");

SetValue(__comboFiles, "text2", "Done");

SetValue(__comboFiles, "alignment", "center");

AddAction(__comboFiles, "comboFilesChanged");

__locRemoveKeyboard = GetLocation(__comboFiles, "RIGHT", __comboFiles, "CENTER", 10);

AddButton(__locRemoveKeyboard, "__buttonKeyboard", "Keyboard", 120, 50);

SetFontSize(__buttonKeyboard, 12);

AddAction(__buttonKeyboard, "hideKeyboard");

__locScriptView = GetLocation("ROOT", "CENTER", __comboFiles, "BOTTOM", 0, 8);

AddTextView(__locScriptView, "__textView", "", DisplayWidth - Relative(40), DisplayHeight - Relative(200), 0);

AddOrSelectTab("Run", "learn.png", "run_icon.png");

OnTabSelected("tabSelected");

SelectTab(0);

CSCS Native Scripting(圖3)-速報App

function hideKeyboard(sender, arg) {

ShowHideKeyboard(__textView, !IsKeyboard(__textView));

}

function comboFilesChanged(sender, arg) {

row = GetValue(sender);

text = "";

if (row == 1) {

text = ReadFileAsString("sfhello.cscs");

} elif (row == 2) {

text = ReadFileAsString("ads.cscs");

} elif (row == 3) {

text = ReadFileAsString("busyIndicators.cscs");

} elif (row == 4) {

text = ReadFileAsString("unitTest.cscs");

CSCS Native Scripting(圖4)-速報App

}

SetText(__textView, text);

}

function tabSelected(sender, arg) {

tabId = int(arg);

if (tabId != 1) {

return;

}

script = GetText(__textView);

RemoveTabViews(1);

try {

Run(script);

} catch(exc) {

AlertDialog("CSCS", exc);

CSCS Native Scripting(圖5)-速報App

WriteConsole(exc);

}

}

CSCS Native Scripting(圖6)-速報App

支援平台:iPhone